(:
XQuery that gets attributes from xsd
:)

declare namespace ns = "http://www.w3.org/2001/XMLSchema";
<xsd-attributes>{
let $doc := doc("xsd.xsd")

for $attributes in $doc//ns:attribute
let $name := $attributes/@name
return
   <attribute name="{$name}"></attribute>
}</xsd-attributes>